<?php echo $this->renderElement('admin/menu'); ?>
<br />

<?php echo $html->link("Add Intervention", '/interventions/addIntervention')."<br /><br />"; ?>

<br />
<h2><?php echo "Liste de Interventions par défaut"; ?></h2>
<table width="100%">
<th>#id</th><th><?php echo "Label"; ?></th><th><?php echo "Default Value"; ?></th><th>Actions</th>
<?php
	foreach($defaults as $intervention):
		echo "<tr>";
		echo "<td>".$html->link("#".$intervention['Intervention']['id'], '/interventions/view/'.$intervention['Intervention']['id'])."</td>";
		echo "<td>".$html->link($intervention['Intervention']['label'], '/interventions/view/'.$intervention['Intervention']['id'])."</td>";
		echo "<td>".$intervention['Intervention']['default_value']."</td>";
		echo "<td>".$html->link(__('view', true), '/interventions/view/'.$intervention['Intervention']['id'])." | ".$html->link(__('edit', true), '/interventions/edit/'.$intervention['Intervention']['id'])." | ".$html->link(__('delete', true), '/interventions/del/'.$intervention['Intervention']['id'])."</td>";				
		echo "</tr>";
	endforeach;
?>
</table>

<br /><br />
<h2><?php echo "Liste de Interventions non liés à un contrat"; ?></h2>
<table width="100%">
<th>#id</th><th><?php echo "Label"; ?></th><th><?php echo "Default Value"; ?></th><th>Actions</th>
<?php
	foreach($unlinked as $intervention):
		echo "<tr>";
		echo "<td>".$html->link("#".$intervention['Intervention']['id'], '/interventions/view/'.$intervention['Intervention']['id'])."</td>";
		echo "<td>".$html->link($intervention['Intervention']['label'], '/interventions/view/'.$intervention['Intervention']['id'])."</td>";
		echo "<td>".$intervention['Intervention']['default_value']."</td>";
		echo "<td>".$html->link(__('view', true), '/interventions/view/'.$intervention['Intervention']['id'])." | ".$html->link(__('edit', true), '/interventions/edit/'.$intervention['Intervention']['id'])." | ".$html->link(__('delete', true), '/interventions/del/'.$intervention['Intervention']['id'])."</td>";				
		echo "</tr>";
	endforeach;
?>
</table>
<br /><br />

<h2><?php echo "Liste des Interventions"; ?></h2>
<table width="100%">
<th>#id</th><th><?php echo "Label"; ?></th><th><?php echo "Default Value"; ?></th><th>Actions</th>
<?php
	foreach($others as $intervention):
		echo "<tr>";
		echo "<td>".$html->link("#".$intervention['Intervention']['id'], '/interventions/view/'.$intervention['Intervention']['id'])."</td>";
		echo "<td>".$html->link($intervention['Intervention']['label'], '/interventions/view/'.$intervention['Intervention']['id'])."</td>";
		echo "<td>".$intervention['Intervention']['default_value']."</td>";
		echo "<td>".$html->link(__('view', true), '/interventions/view/'.$intervention['Intervention']['id'])." | ".$html->link(__('edit', true), '/interventions/edit/'.$intervention['Intervention']['id'])." | ".$html->link(__('delete', true), '/interventions/del/'.$intervention['Intervention']['id'])."</td>";				
		echo "</tr>";
	endforeach;
?>
</table>